1. Field of Invention
The invention is related to communicating between devices using a receive window.
2. Discussion of Related Art
When two computers communicate over a network, a sending computer may send data to a receiving computer. In some circumstances, the receiving computer may not be able to process the data as quickly as it is received. For example, if the sending computer is a faster computer than the receiving computer, the receiving computer may be overwhelmed by the amount of data sent and various problems may occur. For example, some of the data may be lost.
The receiving computer may store the received data in a receive buffer. The received data may remain in the receive buffer temporarily until an application processes the data. If data is received too quickly, it may not be possible for the receiving computer to process the data fast enough. If the receive buffer becomes full, data may be lost and the sender may need to re-send the lost data.
To prevent a fast sending computer from overwhelming a slow receiving computer with too much data, Transmission Control Protocol (TCP) defines a “receive window.” The receive window is the maximum amount of data that the sending computer is allowed to send to the receiving computer before receipt of at least some of the data is acknowledged. The receive window may limit the amount of data (e.g., defined in bytes) that the sending computer may have outstanding (i.e., unacknowledged) to the receiving computer at any given time. Once the sending computer sends the maximum amount of data, the sending computer may not be allowed to send more data until it receives an acknowledgement that at least some of the data has been received.
The receiving computer may advertise the receive window to the sending computer. The size of the receive window may be the size of the receive buffer minus the amount of data currently stored in the receive buffer, per TCP convention.
Some operating systems provide receive windows that are statically-configured. To change the size of the receive window, a person may need to change it manually. A statically-configured receive window may cause the receive window to be too large in some situations and too small in other situations.
One approach to adaptively tuning the receive window is known as “dynamic rightsizing,” and is implemented on some Linux operating systems. Dynamic rightsizing may increase the receive window size in predetermined increments. For example, if the receiver determines that the receive window is too small, it may double the size of the receive window. If the receiver subsequently determines that the receive window size is again too small, the receive window size may be doubled yet again.